// pages/login/login.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userPhone:'',
    sjYzm:''
  },
  yzmChange(event){
    this.setData({
        sjYzm: event.detail
    })
},
    phoneChange(event){
        this.setData({
            userPhone: event.detail
        })
    },
//   验证码
getCode(){
    var sjYzm = '';
    for(var i=0;i<4;i++){
        var num = Math.floor(Math.random() * 10);
        sjYzm +=num;
    }
    wx.showToast({ title: sjYzm, icon: 'none' });
},
//登录判断
   loginBtn(){
        console.log(this.data.sjYzm);
        console.log(this.data.userPhone);
        if(this.data.userPhone == 1){
            wx.navigateTo({
                url: '/pages/xiaoZhangShouYe/xiaoZhangShouYe'
              })
        }else if(this.data.userPhone == 2){
            wx.navigateTo({
                url: '/pages/zhuren/zhuren'
              })
        }else if(this.data.userPhone == 3){
            wx.navigateTo({
                url: '/pages/pmPage/pmPage'
              })
        }else if(this.data.userPhone == 4){
            wx.navigateTo({
                url: '/pages/jyZhiDao/jyZhiDao'
              })
        }else{
            wx.showToast({ title: '手机号不正确', icon: 'none' });
        }
   }
})